﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Common.Criteria;
    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Common
{
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.UserFactory, MarketPulse.DataAccess.Factory", "FetchInfoList")]
    public class UserInfoList : MarketPulseReadOnlyListBase<UserInfoList, UserInfo>
    {

        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private UserInfoList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

            /// <summary>
            /// Method used to get a list of users based on their country and their user role
            /// </summary>
            /// <param name="countryGuid">The Guid of the Country to use to retrieve the list of users</param>
            /// <param name="userRoleGuid">The Guid of the UserRole to use to retrieve the list of users</param>
            /// <returns>A valid (populated)</returns>
            public static UserInfoList GetByCountryGuidAndUserRoleGuid(Guid countryGuid, Guid userRoleGuid)
            {
                return DataPortal.Fetch<UserInfoList>(new CountryGuidAndUserRoleGuidCriteria(countryGuid, userRoleGuid));
            }

            #endregion

        #endregion

    }
}
